;; (function () {
  var myswiper = new Swiper('.swiper1', {
    spaceBetween: 30,
    centeredSlides: true,
    slidesPerView: 1,
    loop: true,
    autoplay: {
      delay: 2500,
      disableOnInteraction: false,
    },
    pagination: {
      el: '.swp1',
      clickable: true,
    },
    navigation: {
      nextEl: '.swiper-button-next',
      prevEl: '.swiper-button-prev',
    }

  });
  var swiper1 = new Swiper('.swiper2', {
    slidesPerView: 1,
    spaceBetween: 30,
    keyboard: {
      enabled: true,
    },
    pagination: {
      el: '.swp2',
      clickable: true,
    },
    navigation: {
      nextEl: '.b_next',
      prevEl: '.b_prev',
    },
  });


  // 选项卡
  window.onload = function () {
    var nav = document.getElementById('p_n_t');
    var oNav = nav.getElementsByTagName('li');
    var container = document.getElementById('container');
    var oDiv = container.getElementsByClassName('p_n_b');
    for (var i = 0; i < oNav.length; i++) {
      oNav[i].index = i;
      oNav[i].onclick = function () {
        for (var i = 0; i < oNav.length; i++) {
          oNav[i].className = '';
          oDiv[i].style.display = "none";
        }
        this.className = 'actionli act';
        oDiv[this.index].style.display = "block"
      }
      for (var m = 1; m < oNav.length; m++) {
        oNav[m].className = '';
        oDiv[m].style.display = "none";
      }
    }
  };
  // 获取cookie   
  function getCookie(key) {
    var _cookie = document.cookie;
    // "key=value; key2=value; key3=value";
    var _cookie_item = _cookie.split("; ");
    var _key = [];
    var _value = _cookie_item.map(item => {
      var _temp = item.split("=");
      _key.push(_temp[0]);
      return _temp[1];
    })
    var index = _key.indexOf(key);
    if (index !== -1) {
      return _value[index];
    }
    return "";
  }
  // function renderHTML() {
  //   let cookieValue = getCookie("username");
  //   var text = document.getElementById("loginreg");
  //   text.innerHTML = cookieValue;
  // }
  // renderHTML();
  var shopbags = document.querySelector(".h_t_shopbags");
  shopbags.onclick = function () {
    location.href = "./shop.html"
  }
  // 面包屑的内容

  var licontent = document.querySelectorAll(".nav_left ul li");
  for (let i = 0; i < licontent.length; i++) {
    licontent[i].index = i;
    licontent[i].onclick = function () {
      var a = licontent[this.index].children[0].innerHTML;
      localStorage.setItem("boadli",a);
     
    }

  }

})();

